// run: $exec > input
#include <iostream>
#include <ctime>
#include <cstdlib>

int main()
{
	std::srand(std::time(0));
	int n = 100000;
	int m = 100000;
	int q = n;
	std::cout << n << ' ' << m << ' ' << q << '\n';
	for (int i = 1; i < n; i++)
		std::cout << i << ' ' << i + 1 << '\n';
	for (int i = 0; i < m; i++)
		std::cout << i + 1 << ' ';
	std::cout << ' ';
	for (int i = 0; i < q; i++)
		std::cout << rand() % n + 1 << ' ' << rand() % n + 1 << ' ' << 10 << '\n';
}

